<?php
namespace app\admin\controller;

//class类和控制器下的类文件名一致


use app\admin\BaseController;
use app\admin\model\Category;
use think\facade\View;

class Goods extends BaseController{

    public function cate()
    {
        $cate = Category::select();
        View::assign('cate',$cate);

        return view();
    }

    public function goodAdd()
    {

        return view();
    }

    public function goodList()
    {

        //使用模型查询来查询数据库中的全部数据到HTML页面循环
        $goodList = \app\admin\model\Goods::select();

        View::assign('goodList',$goodList);
        return view();
    }

}